﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.presentation.nodeFactory;
using umbraco.cms.businesslogic.member;

namespace CommerceForUmbraco.usercontrols.usercontrols.commerce 
{
    public partial class HeaderMemberInfo : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            Member m = Member.GetCurrentMember();
            Node currNode = Node.GetCurrent();

            Member.RemoveMemberFromCache(currNode.Id);
            Member.ClearMemberFromClient(currNode.Id);

            FormsAuthentication.SignOut();
            Session.Clear();
            Session.Abandon(); 
        }
    }
}